<template>
	<div class="mine_div">
		<div class="img_div_wrap"><!-- :login_data="loginData"-->
			<div class="img_div">
				<img src="../../assets/img/login_pic.png" alt="" style="width: 100%; height: 100%; border-radius: 50%;">
			</div>
			<p class="user_name" >{{username}}</p>
			<p class="icon-app_clock" @click="System"></p>
			<p class="icon-app_set"></p>
			<p class="icon-arrsR" @click="goLogin"></p>
		</div>
		<div class="myOrder_div tl">
			我的订单
			<p class="allOrder_p" @click="btn_myorder">全部订单<span class="icon-arrbR"></span></p>
		</div>
		<div class="DIY_div">
			<img src="../../assets/img/xuanchuan.png" alt="" style="width: 100%; height:100%; ">
		</div>
		<div class="mine_menu_div">
			<p class="mine_menu_p" @click="shoppingcart"><span class="icon-app_car"></span>购物车<span class="icon-arrsR"></span></p>
			<p class="mine_menu_p" @click="collection"><span class="icon-app_coll"></span>收藏<span class="icon-arrsR"></span></p>
		</div>
		<div class="mine_menu_div" >
			<p class="mine_menu_p"  @click="language"><span class="icon-app_refresh"></span>更换常用语言 / 货币<span class="icon-arrsR"></span></p>
			<p class="mine_menu_p"  @click="account"><span class="icon-arr_account"></span>账户管理<span class="icon-arrsR"></span></p>
		</div>
		<div class="mine_menu_div">
			<p class="mine_menu_p"><span class="icon-app_help"></span>帮助<span class="icon-arrsR"></span></p>
			<p class="mine_menu_p"><span class="icon-app_about"></span>关于<span class="icon-arrsR"></span></p>
		</div>
		<footer-com></footer-com>
	</div>
</template>
<script>
	import footer from '../footer/footer.vue'
	export default{
		data(){
			return {
				userInfo:{},
				username:'未登录',
			}
		},

		beforeRouteEnter:function(to,from,next){
				// if(to.path == '/mine'){// 判断上一页路由来源， 如果为首页，设置当前要请求首页的接口， 如果为监控，...
				// 	next(function(vm){
				// 		//console.log(vm)
				// 		vm.$store.state.routerIndex = false;
				// 		vm.$store.state.routerDis = false;
				// 		vm.$store.state.routerOrder = false;
				// 		vm.$store.state.routerMine = true;
						
				// 	});
				// },
				if(to.path == '/mine'){
			    	var l = window.localStorage['_login'] || window.sessionStorage['_login'];
			    	if(l){
			    		next()
			    	}else{
			    		next({
			    			path: '/login'
			    		})
			    	}
			    }
		},
		components:{
            "footer-com": footer,
        },
        methods:{
        	System:function(){
        		this.$router.push({ path: '/System' })
        	},
        	//login
        	goLogin:function(){
        		this.$router.push({ path: '/login' })
        	},
        	btn_myorder:function(){
				this.$router.push({ path: '/order' })
			},
			shoppingcart:function(){
				this.$router.push({ path: '/shoppingcart' })
			},
			collection:function(){
				this.$router.push({ path: '/collection' })
			},
			account:function(){
				this.$router.push({ path: '/account' })
			},
			language:function(){
				this.$router.push({ path: '/language' })
			}
        },
        mounted:function(){

        },
        created:function(){
			var loginInfo = {};
			loginInfo = localMethod.prototype.getObject("_login");
			if(loginInfo == undefined){
				console.log('nologin')
			}else{
				console.log(loginInfo)
				this.username = "恩登录了"
			}
			// if(JSON.stringify(localMethod.prototype.getObject("_login")) == "{}"){
			// 	loginInfo = localMethod.prototype.getSessionObj("web_login");
			// }else{
			// }
			this.userInfo = loginInfo;
		},
	}
</script>
<style rel="stylesheet" lang="scss" scoped>
	.mine_div{
		background-color: #F5F5F5;
		padding-bottom: 1.4667rem;
	}
	.img_div_wrap{
		width: 100%;
		height: 4.8rem;
		background-color: #277BDB;
		position: relative;
		
	}
	.img_div{
		width: 2.2667rem;
		height: 2.2667rem;
		border-radius: 50%;
		position:absolute;
		top: 1.2rem;
		left: 0.4rem;
		
	}
	.user_name{
		position: absolute;
		height: 0.5867rem;
		line-height: 0.5867rem;
		color: #FFF;
		left: 3.2rem;
		top: 2.08rem;
		font-family: PingFangSC-Regular;
		font-size: 0.4267rem;
	}
	.icon-app_clock, .icon-app_set, .icon-arrsR{
		position: absolute;
		width: 0.5333rem;
		height: 0.5333rem;
		z-index: 1;
		font-size: 0.5333rem;
		text-align: center;
		top: 0.5333rem;
		line-height: 0.5333rem !important;
	}
	.icon-app_clock{
		right:1.4667rem;
	}
	.icon-app_set{
		right:0.4rem;
	}
	.img_div_wrap .icon-arrsR{
		top: 2.1333rem !important;
		right: 0.4rem;
		color: #FFF;
	}
	.myOrder_div{
		box-sizing: border-box;
		height: 1.4667rem;
		line-height: 1.4667rem;
		background-color: #FFF;
		font-family: PingFangSC-Regular;
		font-size: 0.4rem;
		color: #333333;
		padding: 0 0.4rem;
		position: relative;
	}
	.allOrder_p{
		position: absolute;
		right: 0.4rem;
		top: 0;
		font-family: PingFangSC-Regular;
		font-size: 0.32rem;
		color: #A9A9A9;
	}
	.icon-arrbR{
		margin-left: 10px;
	}
	.mine_menu_div{
		margin-bottom: 0.1333rem;
	}
	.mine_menu_p{
		box-sizing: border-box;
		padding: 0 0.4rem;
		text-align: left;
		height: 1.4667rem;
		line-height: 1.4667rem;
		background-color: #FFF;
		font-size: 0.4rem;
		color: #333333;
		border-bottom: 1px solid #DDD;
		position: relative;
	}
	.mine_menu_p .icon-arrsR{
		    right: 0.4rem;
	}
	.mine_menu_p span[class^=icon]{
		margin-right: 0.2667rem;
		font-size:0.5333rem;
		color: #A9A9A9 !important;
		/* line-height: 1.4667rem !important; */
	    display: inline-block;
	    vertical-align: middle;
	}
	.mine_menu_p span:last-child{
		margin-right:0 !important;
	}
	.mine_menu_div p:last-child{
		border-bottom: none;
	}
</style>